import type { AxiosError, AxiosRequestConfig, AxiosResponse, Method } from 'axios'

export type RequestMethods = Extract<
  Method,
  'get' | 'post' | 'put' | 'delete' | 'patch' | 'option' | 'head'
>

export interface SimpleHttpError extends AxiosError {
  isCancelRequest?: boolean
}

export type SimpleHttpResponse = AxiosResponse & {
  config: SimpleHttpRequestConfig
}

export type SimpleHttpRequestConfig = AxiosRequestConfig & {
  beforeRequestCallback?: (request: SimpleHttpRequestConfig) => void
  beforeResponseCallback?: (response: SimpleHttpResponse) => void
}
